package com.ww;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        //
        StudentManage manager = new StudentManage();
        Scanner sc = new Scanner(System.in);

        while (true) {
            System.out.println("---欢迎使用学生管理系统---");
            System.out.println("1. 添加学生");
            System.out.println("2. 删除学生");
            System.out.println("3. 修改学生");
            System.out.println("4. 查看所有学生");
            System.out.println("5. 退出系统");
            System.out.print("请输入您的选择：");

            int choice = sc.nextInt();
            sc.nextLine(); // 清除输入缓冲

            switch (choice) {
                case 1 -> manager.addStudent();
                case 2 -> manager.deleteStudent();
                case 3 -> manager.updateStudent();
                case 4 -> manager.showAllStudents();
                case 5 -> {
                    System.out.println("感谢您的使用，再见！");
                    sc.close();
                    System.exit(0);
                }
                default -> System.out.println("输入错误，请重新输入！");
            }
        }
    }
}
